package xzr1;


import java.util.ArrayList;
import java.util.List;

class Employee{
    private int id;
    private String name;
    private double salary;

    public Employee() {

    }

    public Employee( String name, double salary) {
        this.name = name;
        this.salary = salary;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String toString() {
        return "员工:'" + name + "工资为：" + salary;
    }
}
public class Work1 {
    public static void main(String[] args) {
        List<Employee> employeeList = new ArrayList<Employee>();
        Employee[] employees = new Employee[3];

        employees[0] = new Employee("王佳佳",3000.0);
        employees[1] = new Employee("李佳佳",10000.0);
        employees[2] = new Employee("顾佳",6000.0);

        for (int i = 0; i < 3; i++) {
            employeeList.add(employees[i]);
        }
        for (Employee employee: employeeList) {
            System.out.println(employee.toString());
        }
    }

}
